﻿/*
Digraph (library for building, traversal, comparison and saving of directed
graph).

Copyright (C) 2014 Dmitry Merzagitovich Arslanov

This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2.1 of the License, or (at your option) any
later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*/

// How to create digraph.
namespace Sample1
{
    // Define digraph types.
    using Vertex = Digraph.Vertex<string, string>;
    using Arc = Digraph.Arc<string, string>;
    using Graph = Digraph.Set<string, string>;
    using Builder = Digraph.Builder<string, string>;

    public static class App
    {
        public static void Main()
        {
            // Create digraph builder.
            Builder builder = new Builder();
            // At first create vertices.
            Vertex vertex1 = builder.NewVertex("v1");
            Vertex vertex2 = builder.NewVertex("v2");
            Vertex vertex3 = builder.NewVertex("v3");
            // And then create arcs.
            Arc arc1 = builder.NewArc(vertex1, vertex2);
            Arc arc2 = builder.NewArc(vertex1, vertex3);
            // Graph is done.
            Graph graph = builder.Digraph;
        }
    }
}
